package com.wushijia.highconcurrency.utils;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ConcurrentUtils {
  public static void main(String[] args){
    //通过synchronized实现的一个线程安全的HashMap，但是并发性能不好
    Map map = Collections.synchronizedMap(new HashMap());

    //并发性能更好，线程安全的HashMap
    ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
  }
}
